Platform Explorer / Nuxeo Platform 5.8

Component org.nuxeo.ecm.platform.smart.query.layouts

Contributions

XML Source

<?xml version="1.0"?>

<component name="org.nuxeo.ecm.platform.smart.query.layouts">

  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
    point="widgettypes">

    <widgetType name="nxql_incremental_smart_query_widget">
      <documentation>
        This widget displays the query builder as well as the query part in a
        textarea in edit mode, and the query part in view mode.

        It can only be used once on a given page, as it is bound to the
        IncrementalSmartquery instance held by the seam component
        'smartNXQLQueryActions'.

        It needs to be bound to the query part, and accepts the the following
        properties configuration:
        <ul>
          <li>
            updateQueryPart: boolean indicationg if the bound query part should
            be updated on ajax calls.
          </li>
          <li>
            selectionLayout: the layout holding conditions to display in this
            builder
          </li>
        </ul>
      </documentation>
      <configuration>
        <categories>
          <category>configuration_not_ready</category>
        </categories>
      </configuration>
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      <property name="template">
        /widgets/nxql_incremental_smart_query_widget.xhtml
      </property>
    </widgetType>

    <widgetType name="incremental_smart_query_condition">
      <documentation>
        This widget displays the query builder inputs for a given
        IncrementalSmartQuery instance.

        It needs to be displayed in a layout using the template
        '/layouts/incremental_smart_query_selection_layout_template.xhtml': this
        template will display all the needed selectors to build the query.

        Its subwidgets configuration is used to display inputs to set the query
        condition right expression. These subwidgets modes can be set according
        to the chosen operator.

        It needs to be bound to an IncrementalSmartQuery instance, and it
        accepts the the following properties configuration:
        <ul>
          <li>
            searchField: string property that will be used to build the
            condition left expression (for instance 'dc:title')
          </li>
          <li>
            availableOperators: property list of available operators (for
            instance 'IN', '=', '!='...)
          </li>
        </ul>
      </documentation>
      <configuration>
        <categories>
          <category>configuration_not_ready</category>
        </categories>
      </configuration>
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      <property name="template">
        /widgets/incremental_smart_query_condition_widget.xhtml
      </property>
    </widgetType>

  </extension>

  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
    point="widgets">

    <widget name="nxql_smart_query_condition_fulltext"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">content</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">ecm:fulltext</property>
        <propertyList name="availableOperators">
          <value>LIKE</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="fulltext" type="text">
          <translated>true</translated>
          <properties widgetMode="edit">
            <property name="required">true</property>
          </properties>
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_title"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">title</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:title</property>
        <propertyList name="availableOperators">
          <value>CONTAINS</value>
          <value>LIKE</value>
          <value>=</value>
          <value>NOT CONTAINS</value>
          <value>NOT LIKE</value>
          <value>!=</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="title" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_created"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.created</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:created</property>
        <propertyList name="availableOperators">
          <value>BETWEEN</value>
          <value>NOT BETWEEN</value>
          <value>&lt;</value>
          <value>&gt;</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="created_before" type="datetime">
          <fields>
            <field>dateValue</field>
          </fields>
          <properties widgetMode="edit">
            <property name="required">true</property>
            <property name="format">#{nxu:basicDateFormater()}</property>
          </properties>
        </widget>
        <widget name="and" type="text">
          <widgetModes>
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='BETWEEN'
              and value.conditionalOperator!='NOT BETWEEN'?'hidden':'view'}
              ]]>
            </mode>
          </widgetModes>
          <properties mode="any">
            <property name="value">
              &amp;nbsp;#{messages['label.and']}&amp;nbsp;
            </property>
            <property name="escape">false</property>
          </properties>
        </widget>
        <widget name="created_after" type="datetime">
          <fields>
            <field>otherDateValue</field>
          </fields>
          <widgetModes>
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='BETWEEN'
              and value.conditionalOperator!='NOT BETWEEN'?'hidden':mode}
              ]]>
            </mode>
          </widgetModes>
          <properties widgetMode="edit">
            <property name="required">true</property>
            <property name="format">#{nxu:basicDateFormater()}</property>
          </properties>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_modified"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.modified</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:modified</property>
        <propertyList name="availableOperators">
          <value>BETWEEN</value>
          <value>NOT BETWEEN</value>
          <value>&lt;</value>
          <value>&gt;</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="modified_before" type="datetime">
          <fields>
            <field>dateValue</field>
          </fields>
          <properties widgetMode="edit">
            <property name="required">true</property>
            <property name="format">#{nxu:basicDateFormater()}</property>
          </properties>
        </widget>
        <widget name="and" type="text">
          <widgetModes>
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='BETWEEN'
              and value.conditionalOperator!='NOT BETWEEN'?'hidden':'view'}
              ]]>
            </mode>
          </widgetModes>
          <properties mode="any">
            <property name="value">
              &amp;nbsp;#{messages['label.and']}&amp;nbsp;
            </property>
            <property name="escape">false</property>
          </properties>
        </widget>
        <widget name="modified_after" type="datetime">
          <fields>
            <field>otherDateValue</field>
          </fields>
          <widgetModes>
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='BETWEEN'
              and value.conditionalOperator!='NOT BETWEEN'?'hidden':mode}
              ]]>
            </mode>
          </widgetModes>
          <properties widgetMode="edit">
            <property name="required">true</property>
            <property name="format">#{nxu:basicDateFormater()}</property>
          </properties>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_expired"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.expired</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:expired</property>
        <propertyList name="availableOperators">
          <value>BETWEEN</value>
          <value>NOT BETWEEN</value>
          <value>&lt;</value>
          <value>&gt;</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="expired_before" type="datetime">
          <fields>
            <field>dateValue</field>
          </fields>
          <properties widgetMode="edit">
            <property name="required">true</property>
            <property name="format">#{nxu:basicDateFormater()}</property>
          </properties>
        </widget>
        <widget name="and" type="text">
          <widgetModes>
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='BETWEEN'
              and value.conditionalOperator!='NOT BETWEEN'?'hidden':'view'}
              ]]>
            </mode>
          </widgetModes>
          <properties mode="any">
            <property name="value">
              &amp;nbsp;#{messages['label.and']}&amp;nbsp;
            </property>
            <property name="escape">false</property>
          </properties>
        </widget>
        <widget name="expired_after" type="datetime">
          <fields>
            <field>otherDateValue</field>
          </fields>
          <widgetModes>
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='BETWEEN'
              and value.conditionalOperator!='NOT BETWEEN'?'hidden':mode}
              ]]>
            </mode>
          </widgetModes>
          <properties widgetMode="edit">
            <property name="required">true</property>
            <property name="format">#{nxu:basicDateFormater()}</property>
          </properties>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_nature"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.nature</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:nature</property>
        <propertyList name="availableOperators">
          <value>IN</value>
          <value>NOT IN</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="nature" type="selectManyDirectory">
          <fields>
            <field>stringArrayValue</field>
          </fields>
          <properties mode="any">
            <property name="directoryName">nature</property>
            <property name="localize">true</property>
          </properties>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_subjects"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.subjects</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:subjects</property>
        <propertyList name="availableOperators">
          <value>IN</value>
          <value>NOT IN</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="subjects" type="template">
          <fields>
            <field>stringArrayValue</field>
          </fields>
          <properties mode="any">
            <property name="template">/widgets/subjects_widget.xhtml</property>
          </properties>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_coverage"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.coverage</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:coverage</property>
        <propertyList name="availableOperators">
          <value>IN</value>
          <value>=</value>
          <value>LIKE</value>
          <value>CONTAINS</value>
          <value>NOT IN</value>
          <value>!=</value>
          <value>NOT LIKE</value>
          <value>NOT CONTAINS</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="coverage_select_multi" type="template">
          <fields>
            <field>stringArrayValue</field>
          </fields>
          <widgetModes>
            <!-- to show only when using 'IN' or 'NOT IN' -->
            <mode value="any">
              <![CDATA[
              #{not empty value.conditionalOperator
              and value.conditionalOperator!='IN'
              and value.conditionalOperator!='NOT IN'?'hidden':mode}
              ]]>
            </mode>
          </widgetModes>
          <properties mode="any">
            <property name="template">
              /widgets/query_multi_coverage_widget.xhtml
            </property>
          </properties>
        </widget>
        <widget name="coverage_select" type="template">
          <fields>
            <field>stringValue</field>
          </fields>
          <widgetModes>
            <!-- to use for '=' or '!=' -->
            <mode value="any">
              #{empty value.conditionalOperator or
              (value.conditionalOperator!='=' and
              value.conditionalOperator!='!=')?'hidden':mode}
            </mode>
          </widgetModes>
          <properties mode="any">
            <property name="template">
              /widgets/query_coverage_widget.xhtml
            </property>
          </properties>
        </widget>
        <widget name="coverage" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
          <widgetModes>
            <!-- use in other cases -->
            <mode value="any">
              <![CDATA[
              #{empty value.conditionalOperator
              or value.conditionalOperator=='IN'
              or value.conditionalOperator=='NOT IN'
              or value.conditionalOperator=='='
              or value.conditionalOperator=='!='?'hidden':mode}
              ]]>
            </mode>
          </widgetModes>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_description"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">description</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:description</property>
        <propertyList name="availableOperators">
          <value>CONTAINS</value>
          <value>LIKE</value>
          <value>=</value>
          <value>NOT CONTAINS</value>
          <value>NOT LIKE</value>
          <value>!=</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="description" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_rights"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.rights</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:rights</property>
        <propertyList name="availableOperators">
          <value>CONTAINS</value>
          <value>LIKE</value>
          <value>=</value>
          <value>NOT CONTAINS</value>
          <value>NOT LIKE</value>
          <value>!=</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="rights" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_source"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.source</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:source</property>
        <propertyList name="availableOperators">
          <value>CONTAINS</value>
          <value>LIKE</value>
          <value>=</value>
          <value>NOT CONTAINS</value>
          <value>NOT LIKE</value>
          <value>!=</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="source" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_format"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.format</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:format</property>
        <propertyList name="availableOperators">
          <value>CONTAINS</value>
          <value>LIKE</value>
          <value>=</value>
          <value>NOT CONTAINS</value>
          <value>NOT LIKE</value>
          <value>!=</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="format" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_language"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.language</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:language</property>
        <propertyList name="availableOperators">
          <value>CONTAINS</value>
          <value>LIKE</value>
          <value>=</value>
          <value>NOT CONTAINS</value>
          <value>NOT LIKE</value>
          <value>!=</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="language" type="text">
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_contributors"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.dublincore.contributors</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">dc:contributors</property>
        <propertyList name="availableOperators">
          <value>IN</value>
          <value>NOT IN</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="contributors" type="template">
          <fields>
            <field>stringListValue</field>
          </fields>
          <properties widgetMode="edit">
            <property name="required">true</property>
          </properties>
          <properties mode="any">
            <property name="template">
              /widgets/user_suggestion_widget_template.xhtml
            </property>
            <property name="userSuggestionSearchType">USER_TYPE</property>
            <property name="hideVirtualGroups">true</property>
          </properties>
        </widget>
      </subWidgets>
    </widget>

    <widget name="nxql_smart_query_condition_path"
      type="incremental_smart_query_condition">
      <labels>
        <label mode="any">label.advanced_search.searchpath</label>
      </labels>
      <translated>true</translated>
      <properties widgetMode="edit">
        <property name="searchField">ecm:path</property>
        <propertyList name="availableOperators">
          <value>STARTSWITH</value>
          <value>NOT STARTSWITH</value>
        </propertyList>
      </properties>
      <subWidgets>
        <widget name="search_path" type="path">
          <labels>
            <label mode="any">label.advanced_search.searchpath</label>
          </labels>
          <translated>true</translated>
          <fields>
            <field>stringValue</field>
          </fields>
        </widget>
      </subWidgets>
    </widget>

  </extension>

  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
    point="layouts">

    <layout name="nxql_incremental_smart_query">
      <templates>
        <template mode="any">/layouts/layout_default_template.xhtml</template>
      </templates>
      <rows>
        <row>
          <widget>nxql_incremental_smart_query_widget</widget>
        </row>
      </rows>
      <widget name="nxql_incremental_smart_query_widget"
        type="nxql_incremental_smart_query_widget">
        <labels>
          <label mode="any">label.smart.query.build</label>
        </labels>
        <translated>true</translated>
        <fields>
          <field></field>
        </fields>
        <properties mode="any">
          <property name="selectionLayout">
            incremental_smart_query_selection
          </property>
          <property name="updateQueryPart">true</property>
        </properties>
        <properties widgetMode="edit">
          <property name="required">true</property>
        </properties>
      </widget>
    </layout>

    <layout name="incremental_smart_query_selection">
      <templates>
        <template mode="any">
          /layouts/incremental_smart_query_selection_layout_template.xhtml
        </template>
      </templates>
      <properties mode="any">
        <property name="hideNotOperator">true</property>
      </properties>
      <rows>
        <row name="nxql_smart_query_condition_fulltext">
          <widget>nxql_smart_query_condition_fulltext</widget>
        </row>
        <row name="nxql_smart_query_condition_title">
          <widget>nxql_smart_query_condition_title</widget>
        </row>
        <row name="nxql_smart_query_condition_created">
          <widget>nxql_smart_query_condition_created</widget>
        </row>
        <row name="nxql_smart_query_condition_contributors">
          <widget>nxql_smart_query_condition_contributors</widget>
        </row>
        <row name="nxql_smart_query_condition_modified">
          <widget>nxql_smart_query_condition_modified</widget>
        </row>
        <row name="nxql_smart_query_condition_expired">
          <widget>nxql_smart_query_condition_expired</widget>
        </row>
        <row name="nxql_smart_query_condition_nature">
          <widget>nxql_smart_query_condition_nature</widget>
        </row>
        <row name="nxql_smart_query_condition_subjects">
          <widget>nxql_smart_query_condition_subjects</widget>
        </row>
        <row name="nxql_smart_query_condition_coverage">
          <widget>nxql_smart_query_condition_coverage</widget>
        </row>
        <row name="nxql_smart_query_condition_description">
          <widget>nxql_smart_query_condition_description</widget>
        </row>
        <row name="nxql_smart_query_condition_rights">
          <widget>nxql_smart_query_condition_rights</widget>
        </row>
        <row name="nxql_smart_query_condition_source">
          <widget>nxql_smart_query_condition_source</widget>
        </row>
        <row name="nxql_smart_query_condition_format">
          <widget>nxql_smart_query_condition_format</widget>
        </row>
        <row name="nxql_smart_query_condition_language">
          <widget>nxql_smart_query_condition_language</widget>
        </row>
        <row name="nxql_smart_query_condition_path">
          <widget>nxql_smart_query_condition_path</widget>
        </row>
      </rows>
    </layout>

  </extension>

</component>